Skip to content

Fix floating point error and refactor Bytes for value types#383

Merged
JosuaCarl merged 5 commits intonextflow-io:devfrom
JosuaCarl:fix-session-memory
May 4, 2026
Merged

Fix floating point error and refactor Bytes for value types#383
JosuaCarl merged 5 commits intonextflow-io:devfrom
JosuaCarl:fix-session-memory

Conversation

@JosuaCarl
Copy link
Copy Markdown
Collaborator

Related Pull-requests

🎯 Motivation

  • Use decimal based division to convert between Bytes, as this is in accordance with SI standards
  • Fix a floating point division error for big numbers

📋 Summary of changes

  • Renaming to improve verbosity of code

✅ Checklist

  • New functionalities are covered by tests
  • Class structure in test reflects class structure in main
  • CHANGELOG.md is updated with a note on your changes
  • Ensure all tests pass (.\gradlew check)

Refactor: Rework of `Bytes` to incorporate binary & decimal-based values

Test: Adjusted tests accordingly
Signed-off-by: Josua Carl <[email protected]>
@JosuaCarl JosuaCarl requested a review from nadnein May 4, 2026 08:40
@JosuaCarl JosuaCarl self-assigned this May 4, 2026
@JosuaCarl JosuaCarl added 🪲 bug Something isn't working 🔀 refactor Change things to leave it the same labels May 4, 2026
@JosuaCarl JosuaCarl marked this pull request as ready for review May 4, 2026 08:40
JosuaCarl added 2 commits May 4, 2026 12:45
# Conflicts:
#	CHANGELOG.md
#	src/testResources/cli/file_checks.json
#	src/testResources/cli/report_test.html
#	src/testResources/observer/file_checks.json
#	src/testResources/report/test_payload.json
Copy link
Copy Markdown
Collaborator

@nadnein nadnein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks!
One small comment, I think we should mention in the docs somewhere that we use the (correct) 10^9 scaling factor for Bytes --> GB conversion and Nextflow does not and therefore it could happen that e.g. 12 GB set as memory by the user for a process is reported as 12.88 GB (SI) in the plugin output files.

@JosuaCarl JosuaCarl requested a review from nadnein May 4, 2026 13:04
@JosuaCarl JosuaCarl merged commit d0e33c8 into nextflow-io:dev May 4, 2026
3 checks passed
@JosuaCarl JosuaCarl deleted the fix-session-memory branch May 4, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪲 bug Something isn't working 🔀 refactor Change things to leave it the same

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants